# Twitter in IRC (via bitlbee)
A quick and dirty mini-guide.
**DIESEN GUIDE GIBT ES AUCH [IN DEUTSCH](https://notabug.org/jayvii/Scripts_Configs/src/master/Twitter%20in%20IRC/deutsch)**

## 1 - Installation
Depending on which distribution you are running, this step changed drastically. Since it is rather pointless to cover each and every one, I'll only explain this  for [Ubuntu](http://www.ubuntu.com/), [Debian](https://www.debian.org/), [Archlinux](https://www.archlinux.org/) and [Voidlinux](http://www.voidlinux.eu/).

### Ubuntu
```
sudo apt-get install bitlbee
```

### Debian
```
su -c "aptitude install bitlbee" root
```

### Archlinux
```
su -c "pacman -S bitlbee" root
```

### Voidlinux
```
su -c "xbps-install -S bitlbee" root
```



## 2 - activating the server
This step also depends on which Distribution you are running or to be precise: which initsystem you are using.

### Ubuntu
Since Ubuntu 15.04, this shouldn't require you to do anything. If you are using an older version, you can and should copy my [ircd-file](https://notabug.org/jayvii/Scripts_Configs/src/master/Twitter%20in%20IRC/ircd) to `/etc/xinetd.d/`.
Assuming, you downloaded the file into your Downloads-folder, issue following command:
```
sudo cp ~/Downloads/ircd /etc/xinetd.d/ircd
```

### Debian
Since Debian 8.0 this shouldn't require you to do anything. If you are using an older version, please refer to the Ubuntu-section above.

### Archlinux
Open up the file `/etc/bitlbee/bitlbee.conf` with root-rights and a texteditor of your choice. In this example, Vi is used, but you really can use any texteditor you like.
```
su -c "vi /etc/bitlbee/bitlbee.conf" root
```

Now remove every "#" sign in following lines (uncomment them):
```
RunMode = ForkDaemon
User = bitlbee
DaemonInterface = 0.0.0.0
DaemonPort = 6667
```

After saving the changes, make sure bitlbee has writing-right in `/var/lib/bitlbee`
```
su -c "chown -R bitlbee:bitlbee /var/lib/bitlbee" root
```

Afterwards, the service can be activated and started:
```
su -c "systemctl enable bitlbee" root
su -c "systemctl start bitlbee" root
```

### Voidlinux
You need to do the same thing, you would do on Archlinux, except for the last step (the activating & starting of the service). For this, do:
```
su -c "ln -s /etc/sv/bitlbee /var/service/bitlbee" root
```

## 3 - setting up the IRC-client
This step highly depends on what client you are using. I will only cover the setup of **"Irssi"**

First, start up Irssi:
```
irssi
```

Afterwards, the bitlbee-server can be added:
```
/network add bitlbee
/server add -auto -network bitlbee localhost
/connect bitlbee
```

Now, switch to the bitlbee-rootchannel (probably the second) and issue following commands in there:
```
register
/oper
```

You will be promted for setting up a password now. This password is required to connect to bitlbee each time you start up Irssi from now on.
```
/channel add -auto -botcmd '/say identify\; /oper' &bitlbee bitlbee
/save
```

in order to add your Twitteraccount to bitlbee, do following:
```
account add twitter ACCOUNTNAME
```
Obviously, you have to replace "**ACCOUNTNAME**" with your twitter accountname.
You can simply connect to it with:
```
account on
```
Now, your twitterfeed should appear in the last IRC-channel.



## 4 - Usage
For a short overview and a quick rundown on "Tiwtter in biltbee", you can watch my [Youtube-Video](https://youtu.be/nIINCZruoS0).
**It is in german, but you can turn on english subtitles, which I prepared.**



## 5 - Other
bitlbee has A LOT more to offer, other than Twitter. So it would be a good idea to take a look at the [Bitlbee-Website](https://www.bitlbee.org/main.php/news.r.html) and at several HowTo's:
> [Bitlbee-Wiki](https://wiki.bitlbee.org/)
> [Archwiki: Bitlbee](https://wiki.archlinux.org/index.php/Bitlbee)
> [Install und Setup Bitlbee](http://510x.se/notes/posts/Install_and_setup_BitlBee/)
